'''
Created on May 29, 2012

@author: ezhang
'''
from core.item import Item
from core.action import Action

class ImmortalityPotion(Item):
    def __init__(self):
        Item.__init__(self, "potion")    # do basic initialization for every item
        self.drinkPotion = False
        self.enabled = False
                
        # build list of actions
        self.add_action(DrinkPotion)
    
    def get_description(self):
            return "Immortality Potion"
        
class DrinkPotion(Action):
    def __init__(self):
        Action.__init__(self, "drink_potion")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Drink Potion"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # only works in basement. add cutscene
    def do_action(self,game,room,request):
        if room.get_id() == 'cliff':
            room.locked = False
        else:
            return
